#include <stdio.h>
#include  <malloc.h>
// 空结构体
struct emptyStruct
{
    /* data */
};
// 可变长结构体
struct incompleteStruct{
    int one;
    int two[]; // 数组的长度是可变的
};
// 空结构体的大小为1
// 可变长结构体，长度有可以确定的长度的部分确定
void main(void){
    printf("sizeof(emptyStruct)=%d\n",sizeof(struct emptyStruct));
    struct emptyStruct es ;
    printf("sizeof(es)=%d\n",sizeof(es));

    printf("sizeof(incompleteStruct)=%d\n",sizeof(struct incompleteStruct));

    struct incompleteStruct  incompleteStruct1={.one=4};
    printf("sizeof(incompleteStruct1)=%d\n",sizeof(incompleteStruct1));

    struct incompleteStruct  *incompleteStruct2 =(struct incompleteStruct *)malloc(24);
    incompleteStruct2->one=99;
    incompleteStruct2->two[0]=100;
    incompleteStruct2->two[1]=100;
    printf("sizeof(*incompleteStruct2)=%d\n",sizeof(*incompleteStruct2));//大小仍然为4
}
